<%
    import com.baoxian.utils.sender.HttpSender;
    import org.jsoup.Jsoup;
    import org.jsoup.nodes.Document;
    import org.jsoup.select.Elements;
    import org.jsoup.nodes.Element;
    import org.apache.http.client.config.RequestConfig;
    import org.apache.http.HttpHost;


    //天安登录
    String proxyHost = "cninsure-2011.gicp.net";
    Integer proxyPort = 11723;
    String proxyName = "admin";
    String proxyPass = "admin";
    org.apache.http.client.config.RequestConfig requestConfig = null;
    org.apache.http.impl.client.CloseableHttpClient httpClient = HttpSender.buildHttpClient(proxyHost, proxyPort, proxyName, proxyPass);
    requestConfig = RequestConfig.copy(HttpSender.getDefaultRequestConfig()).setProxy(new HttpHost(proxyHost, proxyPort)).build();


    String loginURL="http://sso.tianan-insurance.com/login";

    //测试成功
    String result = (String)com.renhe.utils.baowang.HttpSender.doGet(httpClient,loginURL,null,"UTF-8",requestConfig,false);

    Document doc = Jsoup.parse(result);

    String lt = doc.select("input[name=lt]").get(0).val();
    String execution = doc.select("input[name=execution]").get(0).val();

    System.out.println("lt:"+lt);
    System.out.println("execution:"+execution);
//        System.out.println(result);

    Map params=new HashMap<String,String>();
    params.put("_eventId","submit");
    params.put("clientLocation","");
    params.put("execution",execution);
    params.put("lt",lt);
    params.put("username","YC3531B9");
    params.put("password","ta6666");

    result = HttpSender.doPost(httpClient,true, loginURL, null, params, null, "UTF-8", requestConfig, "");

    System.out.println(result);

%>